package com.example.javasample.domain;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;

import java.io.Serial;

/**
 * 书籍
 *
 * @author Kylin
 */
@Schema(name = "书籍", description = "书籍对象")
@TableName("book")
@Data
@EqualsAndHashCode(callSuper = true)
public class BookDO extends BaseEntity {

    @Serial
    private static final long serialVersionUID = 1L;

    @Schema(description = "书籍ID")
    private Long id;

    @Schema(description = "书名")
    private String name;

    @Schema(description = "作者ID")
    private Long authorId;

    @Schema(description = "作者")
    @TableField(exist = false)
    private UserDO author;

}
